function [eqmin] = fractionateOpx(liquidComp,FeMgKD)

MW = [60.085 79.899	101.961	151.9902	71.846	70.9374	40.311	56.079	61.979	94.203	283.89]; % see matlab guide in excel spreadsheet
%     SiO2    TiO2    Al2O3   Cr2O3       FeO     MnO     MgO     CaO    Na2O    K2O    P2O5
%      1            2         3          4              5       6           7           8        9

liquidComp_moles = liquidComp./MW;
liquidComp_moles = 100*liquidComp_moles/nansum(liquidComp_moles); %%normalizes the molar liquid composition, unneccessary step

XRAT = liquidComp_moles(5)./liquidComp_moles(7);
VO = FeMgKD*XRAT;
XOP = VO/(1+VO);


    M_eqmin(1) = 49.7;
    M_eqmin(2) = 0.15;
    M_eqmin(3) = 0.65;
    M_eqmin(4) = 0;
    M_eqmin(5) = 47.5*XOP;
    M_eqmin(6) = 0;
    M_eqmin(7) = 47.5*(1-XOP);
    M_eqmin(8) = 2;
    M_eqmin(9) = 0;
    M_eqmin(10) = 0;
    M_eqmin(11) = 0;
    

    eqmin = M_eqmin.*MW;                % this is the bulk comosition of equilibrium olivine
    eqmin = eqmin./(0.01*sum(eqmin));   % renormalized and in wt%


end

